Add more error prefixing when parsing commit objects
authorColin Walters <walters@verbum.org>
Thu, 15 Jun 2023 18:26:12 +0000 (14:26 -0400)
committerColin Walters <walters@verbum.org>
Thu, 15 Jun 2023 18:39:02 +0000 (14:39 -0400)
commitc71fc3d9940a09287e215797926e591cd72f72c6
tree843c086e9942417374b221c7f2a6b4ef78b3a89e
parentff805f1c4f404c3501bedddc8f70c22aa2b04024
Add more error prefixing when parsing commit objects

I've got more debug information in the error case that motivated
https://github.com/ostreedev/ostree/pull/2884/commits/bae4347abeaa2a66d213758f790058f42cb71fd1
"pull: Add error prefixing for corrupt checksums"
where the sole error is

`error: Invalid checksum of length 0 expected 32`

This must be coming from the pull code in the case where we've
already fetched the commit object.

- Add some error prefixing here in the core commit validation code
- Ensure that we do the validation immediately after loading, including
  of the parent commit reference where I think this error must be coming
  from
- Then the pull code can just safely call `ostree_commit_get_parent`
  which already does the hex conversion etc.
src/libostree/ostree-core.c
src/libostree/ostree-repo-pull.c